<?php
if(!defined('BZ_XTBLOG') || !defined('BZ_WJSCUZ')) {
	exit('Access Denied');
}
$uid=verify_id($_GET['uid']);
$act=$_GET['act'];
$wzxx_title ='注册-'.$wzxx_title.'';
$wzxx_gj    ='注册-'.$wzxx_gj.'';
$wzxx_ms    ='注册-'.$wzxx_ms.'';
if($user_uid){
	 $pdid="1";
}else if($act=="ok"){
	if(empty($_POST[name]) or empty($_POST[email]) or empty($_POST[pass]) or empty($_POST[sj])){
		$pdid="2";
	//}else if(!preg_match('/'.$bzxt[w_url].'/',$url_a)){
		//$pdid='3';
	//}else if( Bingz_yzm($_POST[bzyzm]) != $bzkfyzm && $yzm_reg == '1'){
		//$pdid="70";
	//}elseif($db->get_one('user'," `ip_at` = '$ip' and `time_b` > '$time_jt' ",'')){
		//$pdid="71";
	//}elseif($_COOKIE['bz_user_reg_time']){
		//$pdid="71";
	}elseif($db->get_one('user'," `name` = '$_POST[name]'",'')){
		$pdid="4";
	}elseif(mb_strlen($_POST[name],'utf-8') < 2 or mb_strlen($_POST[name],'utf-8') > 15 ){
		$pdid="5";
	}elseif($db->get_one('user'," `mobile` = '$_POST[sj]'",'') ){
		$pdid="6";
	}elseif($db->get_one('user'," `email` = '$_POST[email]'",'') ){
		$pdid="7";
	}elseif(!preg_match("/^([0-9A-Za-z\-\_])+@([0-9a-zA-Z\.])+([0-9A-Za-z\.])+$/",$_POST[email])){
		$pdid="8";
	}elseif(!preg_match("/^1[0-9]{1}[0-9]{9}$/",$_POST[sj])){
		$pdid="9";
	}else{
		$dluid=$user_class->user_reg($_POST[name],$_POST[sj],$_POST[email],$_POST[pass]);
		if($dluid > '0'){
		    $pdid="10";
        setcookie('bz_user_reg_time','time',$time_mt);
        $hyname=$_POST[name];
        $userpass=$uuid[1];
        if($uid=authcode($_COOKIE['erusd'],'DECODE')){
           $user_tgcs=Bingz_config('user_config_reg_tglx');
           if($db->get_one('user'," `uid` = '$uid' and `user_q_tgs` < '$user_tgcs'",'')){
           	  $user_tglx=Bingz_config('user_config_reg_tglx');
           	  $user_tgjl=Bingz_config('user_config_reg_tgjl');
           	  if($user_tglx == 'money'){
		             Bingz_management($uid,'money','+'.$user_tgjl,'推广奖励！');
           	     Bingz_message_post('0',$uid,'你好！你推荐会员[id:'.$dluid.']注册成功！系统奖励'.Bingz_management_name($user_tglx).'：'.$user_tgjl.'');
           	  }elseif($user_tglx == 'yeobi'){
		             Bingz_management($uid,'yeobi','+'.$user_tgjl,'推广奖励！');
           	     Bingz_message_post('0',$uid,'你好！你推荐会员[id:'.$dluid.']注册成功！系统奖励'.Bingz_management_name($user_tglx).'：'.$user_tgjl.'');
           	  }elseif($user_tglx == 'renminbi'){
		             Bingz_management($uid,'renminbi','+'.$user_tgjl,'推广奖励！','',$Bingz_renminbi_pass);
           	     Bingz_message_post('0',$uid,'你好！你推荐会员[id:'.$dluid.']注册成功！系统奖励'.Bingz_management_name($user_tglx).'：'.$user_tgjl.'');
              }
           	  $db->update('user',array('user_q_tgs' => '+1')," `uid`= '$uid'");
           }
        }
		}else{
		    $pdid="11";
		}
    setcookie('erusd','');
	}
}else {
    if(!$_COOKIE['erusd'] && $uid > '0'){
	      setcookie('erusd',authcode($uid,'ok'));
	  }
    if($user){
		    $pdid="20";
   	}elseif( Bingz_config('user_config_reg') == '2'){//关闭
		    $pdid="21";
        $user_reg_name=Bingz_config('user_config_reg_name');
   	}elseif( Bingz_config('user_config_reg') == '1'){//短信
		    $pdid="22";
        $sms_phone=Bingz_config('user_config_reg_sms_phone');
        $sms_zlm=Bingz_config('user_config_reg_sms_zlm');
    }
}
@include template('head');
@include template('user/user_reg');
@include template('foot');
?>